<script>
  // #1
  console.log(1);

  new Promise((resolve, reject) => {
    resolve(2)
  }).then(res => {
    // #6
    console.log(res) // 2
  });
  console.log(3);

  setTimeout(function () {
    // #7
    console.log(5)
  });
</script>
<script>
  // #2
  console.log(4); 
</script>
<script>
  // #3
  console.log(3);
</script>

<script>
  // #4
  setTimeout(() => {
    // #8
    console.log(8)
  });
</script>
<script>
  // #5
  Promise.resolve(33).then(r => console.log(r)); // #9 => 33
</script>